/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kpsmart.model.business;

import java.util.List;
import kpsmart.model.events.Event;
import kpsmart.model.events.Events;

/**
 * Utility class for key business figures
 *
 * @author Oliver Behncke
 */
public final class Business {

    private Business() {
    }

    /**
     * Create a KBF object for a list of events and a event that defines the
     * last event of the list taken in account for kbf calculation. All newer
     * events are dropped.
     *
     * @param events
     * @param end
     * @return KBF
     */
    public static KeyBusinessFigures keyBusinessFigures(List<Event> events, Event end) {
        return KeyBusinessFigures.create(Events.dropEventsAfter(events, end));
    }

    /**
     * Create a KBF object for a list of events. All elements of the list are
     * taken into account
     *
     * @param events
     * @return KBF
     */
    public static KeyBusinessFigures keyBusinessFigures(List<Event> events) {
        return KeyBusinessFigures.create(events);
    }
}
